#ifndef FILESYS_BUFCACHE_H
#define FILESYS_BUFCACHE_H

#include "devices/disk.h"

#define BUFFER_SIZE 64

void bufcache_init (void);
void block_read (struct disk *d, disk_sector_t sec_no, void *buffer);
void byte_read (struct disk *d, disk_sector_t sec_no, int sector_ofs, int chunk_size, void *buffer);
void block_write (struct disk *d, disk_sector_t sec_no, void *buffer);
void byte_write (struct disk *d, disk_sector_t sec_no, int sector_ofs, int chunk_size, void *buffer);
void flush_dirty_blocks (struct disk *disk);
void thread_flush_dirty_blocks (void *disk_);

#endif /* filesys/bufcache.h */
